<style>
  .wap3-search-content{
    top: 46px; background-color: #fff; bottom: 0;
  }
  .platform-ios.platform-cordova:not(.fullscreen) .wap3-search-content{
    top:66px;
  }
</style>
<ion-view hide-nav-bar="true">

  <form ng-submit="doingSearch()">
    <div class="search-header">
      <div class="bar bar-header item-input-inset" style="border: none; background-size: 0;">
        <label class="item-input-wrapper">
          <i class="icon ion-ios-search placeholder-icon"></i>
          <input type="search" id="txtSearch" autofocus="autofocus" placeholder="搜索" ng-model="pShortName" ng-change="doSomething()">
        </label>
        <button ng-click="toback()" type="button" class="button button-clear" style="color: #636363">取消</button>
      </div>
    </div>
  </form>
  ion-content.wap3-search-content.scroll-content.ionic-scroll
  <div class="clerSearchName">
    <i style="width: 30px;
    height: 30px;
    text-align: center;
    line-height: 30px;" ng-show="pShortName" ng-click="pShortName = ''" class="icon ion-android-close placeholder-icon"></i></div>
  <ion-content class="wap3-search-content">

    <div class="search-body">
      <div  class="list" ng-if="!isAddSerch && isShowHis">
        <div class="item item-divider" >热门搜索</div>
        <div style="overflow: auto;">

          <div style="float: left" class="  search-hot " ng-click="toDetail(l)" ng-repeat="l in hotSearch">
            {{l.productShortName}}
          </div>
        </div>

      </div>

      <div ng-show="hisList.length > 0 && isShowHis" class="list">
        <div style="height: 10px;background-color:#F1F2F6"></div>
        <div class="item item-divider">历史搜索</div>
        <a ng-repeat="l in hisList" ng-click="doingSearch(l)" class="item" href="javascript:">{{l}}</a>
      </div>
      
      <div ng-show="hisList.length > 0 && isShowHis" class="padding" style="text-align: center;">

        <button ng-click="clearHistory()" class="button button-block">
          <img style="    vertical-align: sub;
    margin-right: 10px;" src="img/delete big@2x.png" width="15px" height="18px">清除搜索记录</button>
      </div>

      <ul ng-show="!isShowHis" class="list">
        <li ng-repeat="l in searchList"  class="item">
          <div class="row product-name" ng-click="toDetail(l)">
            <div style="padding-left: 30px; width: 100px; float: left; position: relative;">
              <!--<i class="icon ion-email"></i>-->
              <img class="product-icon" ng-show="l.type == '01'" width="15px" src="https://www.superfa.cn/upload/bann/20160427/1461744645972simu.png">
              <img class="product-icon" ng-show="l.type == '02'" width="15px" src="https://www.superfa.cn/upload/bann/20160427/1461744667912xt.png">
              <img class="product-icon" ng-show="l.type == '03'" width="15px" src="https://www.superfa.cn/upload/bann/20160427/1461744683204zg.png">
              <img class="product-icon" ng-show="l.type == '06'" width="15px" src="https://www.superfa.cn/upload/bann/20160427/1461744602611pevc.png">
              <img class="product-icon" ng-show="l.type == '07'" width="15px" src="img/zq_icon.png">
              <span ng-show="l.type == '01'">阳光私募</span>
              <span ng-show="l.type == '02'">集合信托</span>
              <span ng-show="l.type == '03'">集合资管</span>
              <span ng-show="l.type == '06'">股权基金</span>
              <span ng-show="l.type == '07'">债权基金</span>
              <div class="right-line"></div>
            </div>
            <div ng-show="l.type != '01'" class="col" >{{l.name}}</div>
            <div ng-show="l.type == '01'" class="col">{{l.fpFundInfoDTO.jjmc}}</div>
            <img ng-if="l.saleStatus == 02" style="right: 5px"  class="w4-hot-list-statusimg" src="img/status_yuren.png" width="39px" height="17px">
            <img ng-if="l.saleStatus == 03" style="right: 5px"  class="w4-hot-list-statusimg" src="img/status_mujizhong.png" width="39px" height="17px">
            <img ng-if="l.saleStatus == 04" style="right: 5px"  class="w4-hot-list-statusimg" src="img/status_muman.png" width="51px" height="17px">
            <img ng-if="l.saleStatus == 05" style="right: 5px"  class="w4-hot-list-statusimg" src="img/status_jieshu.png" width="51px" height="17px">
            <!--<img ng-if="l.flagBaoxiao" class="w4-baoxiao-zhutui-statusimg" src="img/status_baoxiao.png" width="24px" height="40px">-->
            <!--<img ng-if="l.flagZhutui && !l.flagBaoxiao" class="w4-baoxiao-zhutui-statusimg" src="img/status_zhutui.png" width="24px"-->
                 <!--height="40px">-->
          </div>

          <div class="row ajd" ng-show="l.type == '01'">
            <div class="col"><p class="red">{{l.fpFundInfoDTO.lsjzJson[0].zdf || '--'}}</p><p>涨跌幅</p></div>
            <div class="col"><p style="color: #3b3b3b">{{l.fpFundInfoDTO.lsjzJson[0].jzdw || '--'}}</p><p>最新净值</p></div>
            <div class="col"><p style="color: #3b3b3b">{{l.fpFundInfoDTO.lsjzJson[0].ljjz || '--'}}</p><p>累计净值</p></div>
            <div class="col"><p class="red">{{l.fpFundInfoDTO.jjjlmc || l.fpFundInfoDTO.jjjlmc2}}</p><p>基金经理</p></div>
          </div>
          <div class="row ajd" ng-show="l.type == '02' || l.type == '03' || l.type == '07'">
            <div class="col"><p class="red">{{l.profitHight.expectAnnualRevenue || '-'}}</p><p>预期年化</p></div>
            <div class="col">
              <p ng-if="userRole == 'ZC'" class="red">{{l.profitHight.pIsAgreement === '1' ? '协议价' : (l.profitHight.pRebateAmount ? l.profitHight.pRebateAmount + '%' : l.profitHight.rebate + '%')}}</p>
              <p ng-if="userRole == 'RZ'" ng-click="goCertification($event)" class="red">认证可见</p>
              <p ng-if="userRole == 'DL'" ng-click="goCertification($event)" class="red">登录可见</p>
              <p>返佣比例</p>
            </div>
            <div class="col"><p style="color: #333">{{l.dueTime || '-'}}个月</p><p>产品期限</p></div>
            <div class="col"><p style="color: #333">{{product.investType[l.investType] || '-'}}</p><p>投资领域</p></div>



          </div>
          <div class="row ajd" ng-show="l.type == '06'">
            <div class="col"><p class="red">{{l.profitHight.expectAnnualRevenue || '-'}}</p><p>基准收益</p></div>
            <div class="col">
              <p ng-if="userRole == 'ZC'" class="red">{{l.profitHight.pIsAgreement === '1' ? '协议价' : (l.profitHight.pRebateAmount ? l.profitHight.pRebateAmount + '%' : l.profitHight.rebate + '%')}}</p>
              <p ng-if="userRole == 'RZ'" ng-click="goCertification($event)" class="red">认证可见</p>
              <p ng-if="userRole == 'DL'" ng-click="goCertification($event)" class="red">登录可见</p>
              <p>返佣比例</p>
            </div>
            <div class="col"><p style="color: #333">{{l.dueTime || '-'}}个月</p><p>产品期限</p></div>
            <div class="col"><p style="color: #333">{{l.productExpandDTO.peOrganizeShape || '-' | zuzhixingshi}}</p><p>组织形式</p></div>



          </div>

          <div ng-show="l.type != '01'" class="row w4-prolist-list-3">
            <div class="w4-prolist-progress">
              <div class="w4-prolist-progress-in-circle" style="left: {{l.process}}%">
                <div class="w4-prolist-progressinfo" ng-if="l.process<90">{{l.process}}%</div>
                <div class="w4-prolist-progressinfo" style="margin-left: -45px" ng-if="l.process>=90">{{l.process}}%</div>
              </div>
              <div class="w4-prolist-progress-in" style="width:{{l.process}}%"></div>
            </div>
          </div>
          <div ng-click="productAddToShop(l.type, l)" class="shop-product-delete" style="margin-top: -10px; margin-bottom: 0px;">
            <i ng-show="l.flagShop"></i><span ng-show="l.flagShop">删除</span>
            <i ng-show="!l.flagShop" style="background-image: url(img/shops/product-add.png)"></i><span ng-show="!l.flagShop">添加</span>
          </div>
        </li>

        <li ng-show="searchList.length < 1">
          <div style="text-align:center;margin:20px 0px;">
            <div><i class="icon ion-search placeholder-icon" style="font-size:100px"></i></div>
            抱歉，未找到“<span style="color:#ff5000">{{pShortName}}</span>”的相关产品
          </div>
          <div class="text-center" style="padding: 5%">
            <button ui-sref="app.upload({pName:pShortName})" class="button button-block  button-assertive button-css" style="border: 1px solid #FF971B;color: #fff;background-color: #FF971B">
              添加相关产品
            </button>
          </div>
        </li>

        <ion-infinite-scroll ng-if="page.hasNaxtPage" on-infinite="loadMore()" distance="1%"></ion-infinite-scroll>
    </ul>

    </div>

  </ion-content>
</ion-view>
